<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;

/**
 * App\Model\UserSalesmanBonusCount
 *
 * @property int $id
 * @property int|null $type 1：会员分销提成，2：一元拉新,3:企业佣金
 * @property int|null $income_type 类型:1收入，0支出
 * @property int $user_id 会员id
 * @property float|null $money 收入的金额
 * @property int $relation_id 关联表id，比如类型是1的会员分销提成关联表是user_commission_details返佣表
 * @property string|null $describe 描述
 * @property \Illuminate\Support\Carbon|null $created_at 创建时间
 * @property \Illuminate\Support\Carbon|null $updated_at 修改时间
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount query()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount whereDescribe($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount whereIncomeType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount whereMoney($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount whereRelationId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount whereType($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount whereUserId($value)
 * @mixin \Eloquent
 * @property-read \App\Model\UserSalesmanInviteOneYuan $salesmanInviteOneYuan
 * @property int|null $relation_user_id 被邀请会员id
 * @method static \Illuminate\Database\Eloquent\Builder|\App\Model\UserSalesmanBonusCount whereRelationUserId($value)
 */
class UserSalesmanBonusCount extends Model
{
    protected $table ="user_salesman_bonus_count";

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
     */
    public function salesmanInviteOneYuan()
    {
        return $this->hasOne(UserSalesmanInviteOneYuan::class, "relation_id", "id");
    }

}
